# Maintainer: 
# Contributor: NicoHood <archlinux {cat} nicohood {dog} de>
# Contributor: Morgenstern <charles [at] charlesbwise [dot] com>

pkgname=cherrytree
pkgver=1.0.2
pkgrel=1
pkgdesc="Hierarchical note-taking application"
arch=('loong64' 'x86_64')
url="https://www.giuspen.com/cherrytree/"
license=('GPL3')
depends=('fmt' 'gspell' 'gtksourceviewmm' 'libxml++2.6' 'uchardet' 'vte3')
makedepends=('cmake' 'python' 'spdlog')
checkdepends=('xorg-server-xvfb')
source=("https://github.com/giuspen/cherrytree/releases/download/v${pkgver}/${pkgname}_${pkgver}.tar.xz"{,.asc})
sha512sums=('917ec9a0b4160328fe281139f95ac119f211a8d5f7bb4b7e6b3fb63d9fb0bc0eedbe6286ccf8627ce718dfeff8d9f9996ffda288ce16f8d8b18a0e64a98fd5bc'
            'SKIP')
validpgpkeys=('C7BF38CE0BD442C2369AA984049128A20CE0648D') # Giuseppe Penone <giuspen [at] gmail [dot] com>

build() {
  cmake -B build -S "${pkgname}_${pkgver}" \
  -DINSTALL_GTEST:BOOL='OFF' \
  -DAUTO_RUN_TESTING:BOOL='OFF' \
  -DCMAKE_BUILD_TYPE='None' \
  -DCMAKE_INSTALL_PREFIX='/usr' \
  -Wno-dev
  cmake --build build
}

check() {
  xvfb-run build/run_tests_with_x_1
  xvfb-run build/run_tests_with_x_2
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
